using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Data;

namespace UI.Control
{
	public class CountToFontSizeConverter : IValueConverter
	{
		#region IValueConverter Members

		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			const int minFontSize = 6;
			const int maxFontSize = 38;
			const int increment = 3;

			int count = (int)value;

			return ((minFontSize + count + increment) < maxFontSize) ? (minFontSize + count + increment) : maxFontSize;
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException("The method or operation is not implemented.");
		}

		#endregion
	}
}
